package com.itwxz.forum.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itwxz.forum.domain.po.ForumPost;
import com.itwxz.forum.domain.vo.ForumPostListVo;
import com.itwxz.forum.domain.vo.ForumPostVo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author Admin
 * @description 针对表【forum_post(论坛帖子表)】的数据库操作Mapper
 * @createDate 2025-05-04 16:29:25
 * @Entity com.itwxz.forum.domain.po.ForumPost
 */
@Mapper
public interface ForumPostMapper extends BaseMapper<ForumPost> {
    IPage<ForumPostListVo> selectPostPageWithLike(
            Page<?> page,
            String query,
            Long userId
    );

    IPage<ForumPostListVo> selectMyPostPageWithLike(
            Page<ForumPostListVo> page,
            Long userId
    );

    IPage<ForumPostListVo> selectMyCollectPostPageWithLike(
            Page<ForumPostListVo> page,
            Long userId
    );

    /**
     * 查询论坛帖子列表
     *
     * @param forumPost 论坛帖子
     * @return 论坛帖子集合
     */
    List<ForumPostVo> selectForumPostList(ForumPost forumPost);
}




